#ifndef AUTO_NAVIGATION_KITTI_DATA_PLAYER_HPP
#define AUTO_NAVIGATION_KITTI_DATA_PLAYER_HPP

#include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/io/pcd_io.h>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <boost/filesystem.hpp>
#include <tf2_ros/static_transform_broadcaster.h>
#include <geometry_msgs/TransformStamped.h>

namespace fs = boost::filesystem;

namespace auto_navigation {

class KittiDataPlayer {
public:
    KittiDataPlayer(ros::NodeHandle& nh, ros::NodeHandle& private_nh);
    ~KittiDataPlayer();
    
private:
    ros::NodeHandle& nh_;
    ros::NodeHandle& private_nh_;
    ros::Publisher points_pub_;
    ros::Timer play_timer_;
    
    std::string kitti_data_path_;
    std::string frame_id_;
    double play_rate_;
    bool loop_;
    std::vector<std::string> file_list_;
    size_t current_frame_;
    
    tf2_ros::StaticTransformBroadcaster static_broadcaster_;
    
    bool loadFileList();
    void timerCallback(const ros::TimerEvent& event);
    void publishPointCloud(const std::string& file_path);
    void publishStaticTransforms();
};

} // namespace auto_navigation

#endif // AUTO_NAVIGATION_KITTI_DATA_PLAYER_HPP 